package com.share.commons.util;

import java.io.File;
import java.io.IOException;

import org.jdom.Document;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;

/**
 * 说明：加载XML文件
 * <br/>编写者：杨浩泉
 * <br/>日期：2010-3-1
 */
public class LoadXmlUtil {

	private static SAXBuilder sb = null ;
	
	static {
		if(null == sb) {
			sb = new SAXBuilder() ;
		}
	}
	
	public static Document getDocument(String path) {
		Document doc = null ;
		File file = new File(path) ;
		try {
			doc =  sb.build(file);
		} catch (JDOMException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} 
		return doc ;
	}
}
